from typing import List, Union


class Vector:
    vector: list = None

    def __init__(self) -> None:
        ...

    def update(self, each_vector: List[list]) -> None:
        each_vector = zip(*each_vector)
        temp = []
        for _ in each_vector:
            temp.append(sum(_))
        each_vector, temp = temp, list()
        for x, y in zip(self.vector, each_vector):
            temp.append((x + y))
        self.vector = temp

    def get_vector(self, update: Union[None, List[list]] = None) -> list:
        if update is not None:
            self.update(update)
        return self.vector

    __iter__ = get_vector


class Location:
    location: list = None

    def __init__(self, location) -> None:
        self.location = location

    def update(self, vector: Vector) -> None:
        now_loc = []
        for x, y in zip(self.location, vector):
            now_loc.append(x + y)
        self.location = now_loc

    def get_location(self, update: Vector) -> list:
        if update is not None:
            self.update(update)
        return self.location


class Item:
    name: str = None
    mass: int = None
    volume: int = None
    density: int = None
    vector: Vector = None
    location: Location = None


class World:
    def __init__(self):
        self.item = []
        self.g = 6.3
